package com.xiebishe.mylibrary.common.pageStatus;

import android.view.View;

import androidx.annotation.IntDef;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

public interface StatusHandler {
    @Retention(RetentionPolicy.SOURCE)
    @IntDef({CONTENT, LOADING, ERROR, EMPTY})
    @interface status {
    }

    int CONTENT = 0;
    int LOADING = 1;
    int ERROR = 2;
    int EMPTY = 3;

    void loading();

    void showContent();

    void error();

    void empty();

    void addOnStatusChangeListener(OnStatusChangeListener listener);

    void removeOnStatusChangeListener(OnStatusChangeListener listener);

    void clearOnStatusChangeListener();

    View getLoadingView();

    void setLoadingView(View loadingView);

    View getErrorView();

    void setErrorView(View errorView);

    View getEmptyView();

    void setEmptyView(View emptyView);

    @status
    int getStatus();
}
